package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_user")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserModel {
    @TableId(type = IdType.AUTO)
    private Integer id;//用户ID
    private String name;//昵称
    private String phone;//电话
    private String faceUrl;//头像
    private Integer status;//1不是商家2是
    private Double voucher;//益联券 初始0 充会员后+2001
    private Double integral;//积分 初始0
    private Integer vip;//是否会员 1是 2否
    private String vipOrderSn;//是否会员 1是 2否
    private Integer raffleNumber;//抽奖次数
    private String invitationCode;//邀请码
    private String invitationCodeUrl;//邀请码二维码路径
    private String transferAccountsCodeUrl;//转账二维码路径
    private Integer businessId;//商家ID
    private String openId;
    private String loginOpenid;
    private Integer roleId;
    private String paymentPassword;
    private Integer customerServiceId;//客服id
    private String salt;
    @TableField(exist = false)
    private AddressModel addressModel;
    @TableField(exist = false)
    private CustomerServiceModel customerServiceModel;
    @TableField(exist = false)
    private String cityName;
    @TableField(exist = false)
    private String areaName;
    @TableField(exist = false)
    private Double allCoupons;
    @TableField(exist = false)
    private Double inviteOrderPoints;
    private String areaId;//所属地区id
    private String cityId;//所属地区id
    private String areaCode;//所属地区id
    @TableField(exist = false)
    private List<String> value;//所属地区id
    private Integer version;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private transient Timestamp invitationTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp updateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;
    /**
     * 成为会员的时间
     */
    private Timestamp vipTime;
    @TableField(exist = false)
    private String areaText;
    @TableField(exist = false)
    private String area;
    @TableField(exist = false)
    private String city;
    @TableField(exist = false)
    private String province;
    @TableField(exist = false)
    private Integer isPassword;//1设置了密码2没有设置密码
    @TableField(exist = false)
    private Integer quiltInviteCount;

    @TableField(exist = false)
    private String inviteStatus;



    /**
     * 美化邀请码url
     */
    private String beautifyInvitationCodeUrl;
    /**
     * 美化账号代码url
     */
    private String beautifyAccountsCodeUrl;

    @TableField(exist = false)
    private String mobilePhoneNumberOppositeTransferAccount;

    private transient String ip;
}
